#coding:utf-8
import json

def update_price(new_price):
    price_table = {}
    with open("price.json", "r") as fd:
        price_table = json.load(fd)
    for item_name, price in new_price.items():
        price_table[item_name] = price
    with open("price.json", "w+") as fd:
        json.dump(price_table, fd, indent=2, ensure_ascii=False)

if __name__ == '__main__':
    name = input("name:")
    price = input("price:")
    update_price({name: price})
